package com.dosh;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

/**
 * 
 * Container of the layouts of the tabs
 *
 */
public class TabLayout extends TabActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.show);
        
        TabHost tabHost = getTabHost();
        
        /**
         * first Graph with title and icon
         */
        TabSpec graf1spec = tabHost.newTabSpec("Verlauf");
        graf1spec.setIndicator("Verlauf", getResources().getDrawable(R.drawable.graf_line));
        Intent i3 = new Intent(this, XYChartBuilder.class);
        graf1spec.setContent(i3);
        
        /**
         * second Graph with title and icon
         */
        TabSpec graf2spec = tabHost.newTabSpec("Kategorien");
        graf2spec.setIndicator("Kategorien", getResources().getDrawable(R.drawable.graf_line));
        Intent i2 = new Intent(this, PieChartBuilder.class);
        graf2spec.setContent(i2);
        
        /**
         * third Graph with title and icon
         */
        
        TabSpec graf3spec = tabHost.newTabSpec("Buchungen");
        graf3spec.setIndicator("Buchungen", getResources().getDrawable(R.drawable.graf_line));
        Intent i1 = new Intent(this, Booking_ListView.class);
        graf3spec.setContent(i1);
        
        /**
         *  Adding all TabSpec to TabHost
         */ 
        tabHost.addTab(graf1spec);
        tabHost.addTab(graf2spec); 
        tabHost.addTab(graf3spec); 
    }
}